package com.test.p06prototype.example01;

import java.util.Date;

public class Client02 {
    public static void main(String[] args) throws CloneNotSupportedException {
        Sheep2 Sheep2 = new Sheep2();
        Sheep2.setBirthday(new Date());
        Sheep2.setName("duoli");

        System.out.println(Sheep2);


        Sheep2 Sheep22  = (Sheep2)Sheep2.clone();

        System.out.println(Sheep22);
        //使用的是浅拷贝，birthday是同一个对象
        System.out.println(Sheep2.getBirthday() == Sheep22.getBirthday());
        System.out.println(Sheep2.getBirthday());
        System.out.println(Sheep22.getBirthday());
        Sheep2.getBirthday().setTime(113493423434L);
        System.out.println(Sheep2.getBirthday());
        System.out.println(Sheep22.getBirthday());
    }
}
